//
//  SHCreditCardSearchCell.m
//  JiFengDaRen
//
//  Created by SH_iOS on 2017/11/30.
//  Copyright © 2017年 SH_iOS. All rights reserved.
//
#define KMETEXTCOLOR [UIColor colorWithHexString:@"#666666"]

#import "SHCreditCardSearchCell.h"

@implementation SHCreditCardSearchCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.imgView = [[UIImageView alloc]init];
        self.imgView.contentMode = UIViewContentModeScaleAspectFit;
        [self.contentView addSubview:self.imgView];
        self.titleLabel = [[UILabel alloc]init];
        self.titleLabel.textColor = KMETEXTCOLOR;
        self.titleLabel.font =  KSHSystemFont(14);
        self.textLabel.numberOfLines = 0;
        [self.contentView addSubview:self.titleLabel];
      
    
        
        self.line = [[UIView alloc]initWithFrame:CGRectMake(__I6Width(56),__I6Height(50)-0.5, KScreenWidth, 0.5)];
        self.line.backgroundColor = KLINECOLOR;
        [self.contentView addSubview:self.line];
        
    }
    
    return self;
}

- (void)layoutSubviews{
    
    [self.imgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(__I6Width(30));
        make.height.mas_equalTo(__I6Width(30));
        make.left.mas_equalTo(self.mas_left).with.offset(__I6Width(15));
        make.centerY.mas_equalTo(self.mas_centerY);
        
    }];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.imgView.mas_right).with.offset(__I6Width(11));
        make.centerY.mas_equalTo(self.mas_centerY);
        
    }];
    
    
}

- (void)setLeftImgWithImgName:(NSString *)imgName title:(NSString *)title{
    self.imgView.image = [UIImage imageNamed:@"unionpay"];
    self.titleLabel.text = title;
}
- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated{
    [super setHighlighted:highlighted animated:animated];
    if (highlighted) {
        self.backgroundColor = KCELLHIGHTLIGHTED;
    }else{
        self.backgroundColor = [UIColor whiteColor];
        
    }
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated{
    [super setSelected:selected animated:animated];
    
    if (selected) {
        self.backgroundColor = KCELLHIGHTLIGHTED;
    }else{
        self.backgroundColor = [UIColor whiteColor];
        
    }
    
    
}


@end
